package com.cloudbroker.bcs.platform.ltb.middle.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by lili19289 on 2016/9/19.
 */
public class ClientMsgUtil {

   private static Pattern p = Pattern.compile("(\\{[^\\}]+})");


    public static String replace(String content,String... codes){
        for(String code: codes){
            Matcher m = p.matcher(content);
            if(m.find()){
                content= content.replace(m.group(),code);
            }
        }
        return content;
    }

    public static void main(String[] args){
        String str="您的验证码是：{0},你的手机号是{1}";

        str=replace(str,"q11","123");
        System.out.println(str);
    }



}
